package a_star

import "fmt"

type tNode struct {
	id string
	x int
	y int
	measuredWeight int
	estimatedWeight int
}

func NewNode(id string, x int, y int) INode {
	return &tNode{
		id,x, y, MaxWeight,0,
	}
}

func (me *tNode) ID() string {
	return me.id
}


func (me *tNode) GetX() int {
	return me.x
}

func (me *tNode) GetY() int {
	return me.y
}

func (me *tNode) SetX(x int) {
	me.x = x
}

func (me *tNode) SetY(y int) {
	me.y = y
}

func (me *tNode) SetEstimatedWeight(w int) {
	me.estimatedWeight = w
}

func (me *tNode) SetMeasuredWeight(w int) {
	me.measuredWeight = w
}

func (me *tNode) GetMeasuredWeight() int {
	return me.measuredWeight
}

func (me *tNode) GetTotalWeight() int {
	return me.estimatedWeight + me.measuredWeight
}

func (me *tNode) String() string {
	return fmt.Sprintf("%s(%v+%v)", me.id, me.measuredWeight, me.estimatedWeight)
}